#include <iostream> 
#include <string>
#include <map>
//#include <algorithm>

using namespace std; 

int main (){

	int num_ent, number;

	map <string,int> list_tel;
	map<string,int>::iterator it;
 
	string name, name_f;

	cout << "Introduce el número de entradas para el listin: "<<endl; 
	cin >> num_ent;

	for(int i=0; i<num_ent; i++)
	{
		cout << endl <<"Nombre: " ;
		cin >> name;
		cout << "Teléfono de " << name << ": "<< endl;
		cin >> number;

		list_tel[name]=number;
	}
cout << "Base de datos creada." << endl << endl << "¿Nombre? : ";
cin >> name_f;

if (name_f !="fin")
{
	it=list_tel.find(name_f);
	
	if(it!=list_tel.end())

	{
		cout << " Número: " << list_tel.find(name_f)->second<< endl;
	}
	else
	{
		cout << "Error 404. Persona no encontrada" << endl;
	}
}
return 0;
}
